﻿<p><button id="btn" @onclick="@(HandleClicks ? (Action)IncrementCount : null)">Click me</button></p>

@code {
    public int Counter { get; set; }

    [Parameter]
    public bool HandleClicks { get; set; } = true;

    void IncrementCount() { Counter++; }
}